import type { PropType } from 'vue'
import type { ExtrackExpose, ExtractProps } from '@/utils/type'
import { PopupNS } from '@/components'
import type Com from './index.vue'
import { useNamespace } from '@/utils'

export namespace variables {
  export const ns = useNamespace('ConfirmPopup')
}
type Btn = Partial<(PopupNS.Props['btns'] & {})[number] & { show: boolean }>
export namespace ConfirmPopupNS {
  export const name = variables.ns.name
  export const props = {
    popupProps: Object as PropType<Omit<PopupNS.Props, 'title'>>,
    /**
     * 提示内容
     */
    prompt: String,
    /**
     * 取消按钮
     */
    cancelBtn: Object as PropType<Btn>,
    /**
     * 确认按钮
     */
    confirmBtn: Object as PropType<Btn>,
    /**
     * 标题
     */
    title: String
  }
  type BaseProps = ExtractProps.Types<typeof props>
  export type Props = BaseProps
  export const Component = <{
    new(): {
      $props: Props
    }
  }>{}
  export type Instance = ExtrackExpose.Types<typeof Com>
}